class_name RelicUI
extends Control

@export var relic: Relic : set = _set_relic

@onready var icon: TextureRect = $Icon
@onready var animation_player: AnimationPlayer = $AnimationPlayer

func _set_relic(value: Relic) -> void:
	relic = value
	if not is_node_ready():
		await ready
	icon.texture = relic.icon


func _on_gui_input(event: InputEvent) -> void:
	if event.is_action_pressed("left_mouse"):
		Events.do_relic_tooltip_request(relic)


func flash() -> void:
	animation_player.play("flash")
